package com.sinosoft.oms.service.impl;

import com.sinosoft.oms.dto.OrderBean;
import com.sinosoft.oms.entity.oms.Appnt;
import com.sinosoft.oms.entity.oms.Insured;
import com.sinosoft.oms.entity.oms.Order;
import com.sinosoft.oms.entity.oms.Product;
import com.sinosoft.oms.service.AppntService;
import com.sinosoft.oms.service.InsuredService;
import com.sinosoft.oms.service.OrderService;
import com.sinosoft.oms.service.ProductService;
import com.sinosoft.oms.mapper.OrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author:Frankiegg
 * @date:2018/5/15
 * @project:bee
 * @Modified By:
 **/
@Service("dealOrder")
public class OrderServiceImpl implements OrderService {
    @Autowired
    private AppntService appntService;
    @Autowired
    private InsuredService insuredService;
    @Autowired
    private ProductService riskService;
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public boolean insertOrder(Order order, Appnt appnt, Insured insured, Product product){
        order.setAmnt((double)11);
        orderMapper.insertOrder(order);
        return false;
    }

    @Override
    public boolean deleteOrder(String orderId) {
        orderMapper.deleteOrderById(orderId);
        return false;
    }

    @Override
    public boolean updateOrder(Order order, Appnt appnt, Insured insured, Product product) {
        orderMapper.updateOrderById(order);
        return false;
    }

    @Override
    public OrderBean findByOrderId(String orderId) {
        System.out.println(orderMapper.findOrderById(orderId));
        return null;
    }


}
